// pages/detail-video/index.js
import {
  getMVDetail, getMVURL, getRelateMV
} from '../../services/modules/video'
Page({

  /**
   * 页面的初始数据
   */
  data: {
    id: 0,
    mvUrl: '',
    mvInfo: {},
    recommendMv: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.setData({
      id: options.id
    })
    this.init()
  },
  
  // 初始化
  async init() {
    console.log('??');
    const res1 = await getMVURL(this.data.id)
    const res2 = await getMVDetail(this.data.id)
    const res3 = await getRelateMV(this.data.id)
    console.log(res1, res2, res3);
    this.setData({
      mvUrl: res1.data.url,
      mvInfo: res2.data,
      recommendMv: res3.data
    })
  }

})